"use strict";
function sum(a, b, ...arr) {
    console.log(arr); //[2,4]
    let total = a + b;
    for (let x of arr) {
        total += x;
    }
    console.log(total); //[2,4]
    return total;
}
sum(1, 2, 3, 4);
